import pygame

import DolphinGame


class Window:
    def __init__(self, window_size=(800, 600), title="DolphinGame"):
        self.window_size = window_size
        self.title = title
        self.screen = None

    def creat_window(self):
        self.screen = pygame.display.set_mode(self.window_size)
        pygame.display.set_caption(self.title)

    def fill(self, color=(255, 255, 255)):
        self.screen.fill(color)


if __name__ == '__main__':
    DolphinGame.init()
    window = Window()
    window.creat_window()

    running = True
    while running:
        for event in DolphinGame.get():
            if event.type == DolphinGame.QUIT:
                running = False
            if event.type == DolphinGame.KEYDOWN:
                if event.key == DolphinGame.K_q:
                    running = False

        window.fill()
        DolphinGame.flip()
